* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body,
.container {
    height: 100%;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    /* background: #fafafa; */
    color: #333;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
}

/* 1. 主轮播图 50% 高度 */
.main-carousel {
    height: 42vh;
    position: relative;
    /* overflow: hidden; */


}

.main-carousel .track {
    display: flex;
    overflow: hidden;
}

.main-carousel .slide {
    flex: 0 0 100%;
    /* 每个slide占满track宽度 */
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    align-items: center;
    background: linear-gradient(180deg, #ecf2fb, #c0daf9);
    position: relative;
    
    padding-bottom: 30px;

}

.main-carousel .slide .main-img {
    width: 200px;
    /* 图片宽高占slide的一半 */
    height: 200px;
    object-fit: cover;
    user-select: none;
    pointer-events: none;
    padding: 10px;

}

.main-carousel .slide .tags-img {
    /* margin-top: 20px; */
    width: 120px;
    height: 30px;

}



.main-carousel .slide .info {
    color: #293540;
    text-align: center;
}

.main-carousel .slide .info .title {
    font-weight: bold;
    /* margin: 10px 0; */
    font-size: 20px;
}

.main-carousel .slide .info .price {
    font-weight: bold;
    font-size: 24px;
}

.main-carousel .slide .info .tags {
    font-size: 14px;
    position: absolute;
    bottom: 4%;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-evenly;
}

.main-carousel .carousel-item {
    width: 100vw;
    height: 100%;
    background-color: #fff;
}

.main-carousel .track-left {
    position: absolute;
    left: 0;
    top: 50%;
    /* transform: translateY(-50%); */
    background-color: #fff;
    padding: 4px 8px;
    border-radius: 0 5px 5px 0;
    z-index: 50;
}

.main-carousel .track-left img {
    width: 26px;
    height: 26px;
}

.main-carousel .track-left .tips {
    font-weight: bold;
    font-size: 12px;
}

.main-carousel .track-right {
    position: absolute;
    z-index: 50;
    right: 0;
    top: 50%;
    transform: translateY(-25%);

}

.track-right .items-list {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 240px;
    padding-right: 15px;
    /* background-color: #fff; */


}

.items-list .item {
    display: flex;
    flex-direction: column;

}

.track-right .items-list .item img {
    width: 26px;
    height: 26px;
    margin-bottom: 5px;
}

.items-list .item .tips {
    font-weight: bold;
    font-size: 12px;
}

.carousel-wrapper {
    height: 100%;
    overflow: hidden;
    position: relative;
}

.carousel-track {
    display: flex;
    height: 100%;
    transition: transform 0.5s ease;
    will-change: transform;
    position: relative;
}

/* .carousel-track img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    user-select: none;
    -webkit-user-drag: none;
} */

/* 2. 随机商品轮播 10% 高度 */

.random-item-carousel {
    min-height: 150px;
    overflow: hidden;
    width: 100%;
    margin-top: 5px;
    position: relative;
}

.random-item-carousel .carousel-top {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #fff;
    padding: 10px;
    /* border-bottom: 1px solid #ddd */
}

.random-item-carousel .carousel-top .carousel-title {
    font-size: 16px;
    font-weight: bold;
    margin-right: 10px;
}

.random-item-carousel .carousel-top .carousel-desc {
    font-size: 14px;
    color: #999;
}


.random-item-carousel .carousel-wrapper {
    margin: 0 10px;
}

.random-item-carousel .carousel-track {
    display: flex;
    flex-wrap: nowrap;
    will-change: transform;
    gap: 10px;
    /* js 设置宽度 */

}

.random-slide-item {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
    position: relative;

}

.full-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.random-item-carousel .carousel-track .tag-tips {
    position: absolute;
    bottom: 0;
    right: 0;
    padding: 2px 8px;
    border-radius: 8px 0 0px 0;
    color: #fff;
    font-weight: 600;
    font-size: 12px;
    text-align: center;

}


/* 3. 筛选组合，占剩余空间 */
.filter-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px;
    /* overflow-y: auto; */
    background: #fff;
    border-top: 1px solid #ddd;
}

.filter-tabs {
    display: flex;
    justify-content: space-evenly;
    gap: 10px;
    margin-bottom: 10px;
}

.filter-btn {
    padding: 8px 14px;
    background: #eee;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    user-select: none;
    transition: background 0.3s;
}

.filter-btn.active,
.filter-btn:hover {
    /* background: #54b1ed; */
    color: white;
}

.product-list {
    flex: 1;
    /* overflow-y: auto; */
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.product-list .product-item {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 10px;
    text-align: center;
    background: #fafafa;

}

.product-list .product-item .product-item-img {
    position: relative;
}

.product-list .product-item .product-item-img img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 4px;
}

.product-list .product-item .tag-tips {
    position: absolute;
    bottom: 3px;
    left: -1px;
    color: #fff;
    font-weight: 600;
    font-size: 10px;
    text-align: center;
    color: white;
    padding: 4px 10px;
    font-weight: bold;
    display: inline-block;
    /* clip-path: polygon(15% 0%, 100% 0%, 85% 100%, 0% 100%); */
    /* border-radius: 6px; */
    border-radius: 33% 9% 29% 8% / 48% 13% 44% 14%;
    /* 对 clip-path 无效，仅在视觉上略有柔和边缘 */
    font-size: 14px;

}

.product-list .product-item .title {
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 18px;
    color: #333;
    margin-bottom: 4px;
}

.product-list .product-item .price {
    display: flex;
}

.product-list .product-item .price .price-desc {
    font-size: 14px;
    font-weight: 400;
    color: #666666;
    margin-right: 10px;
}
.product-list .product-item .price .price-unit {
    font-size: 20px;
    font-weight: bold;
    color: #f67a29;
}

/* 4. 右下角回到顶部按钮 */
#scrollTopBtn {
    position: fixed;
    width: 40px;
    height: 40px;
    bottom: 90px;
    right: 20px;
    background-color: #54b1ed;
    border: none;
    color: white;
    padding: 10px 14px;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    font-size: 18px;
    user-select: none;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

/* 5. 底部固定按钮 */
.fixed-bottom-btns {
    position: fixed;
    bottom: 0;
    width: 100%;
    background: white;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: space-around;
    padding: 12px 0;
    box-shadow: 0 -1px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.fixed-bottom-btns button {
    background-color: #54b1ed;
    border: none;
    color: white;
    padding: 12px 40px;
    border-radius: 30px;
    font-size: 16px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.3s;
}

.fixed-bottom-btns button:hover {
    background-color: #3a8bdc;
}

/* 滑动切换手势区域 */
.main-carousel,
.random-item-carousel {
    touch-action: pan-y;
}

/* 蒙版，覆盖全屏 */
.mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
}

/* 弹窗，占满屏幕宽度，固定底部 */
.modal {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    background: #fff;
    border-radius: 12px 12px 0 0;
    z-index: 10000;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    max-height: 70vh;
    overflow-y: auto;
}

/* 弹窗头部 */
.modal-header {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    font-weight: 600;
    border-bottom: 1px solid #eee;
    font-size: 16px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    color: #333;
}

/* 弹窗内容 */
.modal-content {
    padding: 16px;
    text-align: center;
}

.modal-content img {
    width: 100%;
    height: auto;
    max-width: 200px;
    /* 让图片不要太大，居中 */
    margin: 40px auto;
    border-radius: 6px;
}

.product-info {
    margin-top: 12px;
    font-size: 14px;
    color: #333;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.rarity {
    background: #f0c14b;
    color: #111;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    margin-right: 6px;
}

/* 隐藏类 */
.hidden {
    display: none;
}


/* 红色条幅 */
.guarantee-banner {
    background: linear-gradient(90deg, #ff557a, #ff2d65);
    color: white;
    font-weight: bold;
    padding: 12px 20px;
    text-align: center;
    font-size: 16px;
    border-radius: 0 0 12px 12px;
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* 可以添加一个简单的图标，类似你的示意 */
.guarantee-banner svg {
    width: 20px;
    height: 20px;
    fill: white;
}


.filter-section {
    padding: 12px 16px;
    background: #fff;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.filter-section h3 {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 12px;
    color: #222;
}

/* .filter-tabs {
    display: flex;
    gap: 24px;
    justify-content: start;
    align-items: center;
    flex-wrap: nowrap;
} */

.filter-btn {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #000;
    /* 未选中是黑色 */
    padding: 6px 0 26px;
    user-select: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-weight: 500;
    min-width: 48px;
    transition: color 0.3s;
}

/* 文字未选中是黑色，选中是橙色，无背景色 */
.filter-btn.active {
    color: #ff9d2f;
    /* 橙色 */
    font-weight: 600;
}

/* 百分比标签 */
.percentage {
    position: absolute;
    bottom: 2px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 12px;
    line-height: 1.3;
    min-width: 48px;
    text-align: center;
    padding: 2px 10px;
    user-select: none;
    transition: all 0.3s;
}

/* 未选中百分比灰色，无背景 */
.filter-btn:not(.active) .percentage {
    color: #999;
    background: none;
    font-weight: 400;
    min-width: auto;
    padding: 0;
}

/* 选中时百分比白色，背景橙色圆角 */
.filter-btn.active .percentage {
    color: #fff;
    background-color: #ff9d2f;
}


.tags-container {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
    border-radius: 4px;
    font-weight: 500;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
}

.tag {
    font-size: 14px;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;

}

.legendary {
    color: #ff0000;
    /* 传说红 */
}

.epic {
    color: #6a5acd;
    /* 史诗紫 */
}

.rare {
    color: #d4af37;
    /* 稀有黄 */
}

.advanced {
    color: #007acc;
    /* 高级蓝 */
}